package com.umeng.soexample.network;

import com.umeng.soexample.bean.AddAddressEntity;
import com.umeng.soexample.bean.AddressListEntity;
import com.umeng.soexample.bean.BrandGoodsEntity;
import com.umeng.soexample.bean.CollectionEntity;
import com.umeng.soexample.bean.AddCarEntity;
import com.umeng.soexample.bean.BrandEntity;
import com.umeng.soexample.bean.CarListEntity;
import com.umeng.soexample.bean.CategoryLeftEntity;
import com.umeng.soexample.bean.CategoryRightEntity;
import com.umeng.soexample.bean.CommunityEntity;
import com.umeng.soexample.bean.CouponListEntity;
import com.umeng.soexample.bean.CreateOrderEntity;
import com.umeng.soexample.bean.DelAddressEntity;
import com.umeng.soexample.bean.GoodsListEntity;
import com.umeng.soexample.bean.GoodsValuesEntity;
import com.umeng.soexample.bean.HomeBannerEntity;
import com.umeng.soexample.bean.HomeGoodsEntity;
import com.umeng.soexample.bean.HomeMenuEntity;
import com.umeng.soexample.bean.HomeRecommendEntity;
import com.umeng.soexample.bean.SeeCategoryEntity;
import com.umeng.soexample.bean.SeeListEntity;
import com.umeng.soexample.bean.SelGoodsValuesEntity;
import com.umeng.soexample.bean.SelUserEntity;
import com.umeng.soexample.bean.ShoesEntity;
import com.umeng.soexample.bean.ShopGoodsEntity;
import com.umeng.soexample.bean.ShowEntity;
import com.umeng.soexample.bean.UncollectionEntity;
import com.umeng.soexample.bean.UpdateUserEntity;
import com.umeng.soexample.bean.UploadHeadEntity;
import com.umeng.soexample.bean.UserEntity;

import java.util.List;

import io.reactivex.Observable;
import okhttp3.MultipartBody;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;

/**
 * 项目中网络请求接口入口
 * */
public interface API {

    public final static String BaseUrl = "http://169.254.154.190/yoho";
 //  public final static String BaseUrl = "http://169.254.14.6/yoho";

    /**
     * 1.首页菜单接口
     * http://169.254.134.250/yoho/home_menu.php
     * */
    @GET("home_menu.php")
    Observable<HomeMenuEntity> home_menu_request();


    /**
     * 2.首页广告接口
     */
    @GET("Home_banner.php")
    Observable<HomeBannerEntity> home_banner_request();

    /**
     * 3.首页推荐接口
     */
    @FormUrlEncoded
    @POST("home_recommend.php")
    Observable<HomeRecommendEntity> home_recommend_request(@Field("request")String request);

    /**
     * 4.首页列表接口
     */
    @FormUrlEncoded
    @POST("home_goods.php")
    Observable<HomeGoodsEntity> home_goods_request(@Field("request")String request);

    /**
     * 5.分类中品类左列接口
     */
    @FormUrlEncoded
    @POST("category_all.php")
    Observable<CategoryLeftEntity> category_all_request(@Field("request")String request);

    /**
     * 6.分类中品类右列接口
     */
    @FormUrlEncoded
    @POST("category_goods.php")
    Observable<CategoryRightEntity> category_goods_request(@Field("request")String request);

    /**
     * 7.分类中品牌接口
     */
    @FormUrlEncoded
    @POST("Brand_list.php")
    Observable<BrandEntity> brand_list_requwst(@Field("request")String request);

    /**
     * 8.球鞋交易接口
     */
    @FormUrlEncoded
    @POST("shoes_list.php")
    Observable<ShoesEntity> shoes_list_request(@Field("request")String request);

    /**
     * 9.逛分类接口
     */
    @FormUrlEncoded
    @POST("see_category.php")
    Observable<SeeCategoryEntity> see_category_request(@Field("request") String request);

    /**
     * 10.逛列表接口
     */
    @FormUrlEncoded
    @POST("see_list.php")
    Observable<SeeListEntity> see_list_request(@Field("request") String request);

    /**
     * 11.社区列表接口
     */
    @FormUrlEncoded
    @POST("community.php")
    Observable<CommunityEntity> community_request(@Field("request") String request);


    /**
     * 12.Show列表接口
     */
    @FormUrlEncoded
    @POST("show.php")
    Observable<ShowEntity> show_request(@Field("request") String request);

    /**
     * 13.商品列表接口 goods_list.php
     */
    @FormUrlEncoded
    @POST("goods_list.php")
    Observable<GoodsListEntity> goods_list_request(@Field("request") String request);

    /**
     * 14.店铺商品接口 shop_goods.php
     */
    @FormUrlEncoded
    @POST("shop_goods.php")
    Observable<ShopGoodsEntity> shop_goodst_request(@Field("request") String request);

    /**
     * 15.品牌商品列表接口 brand_goods.php
     */
    @FormUrlEncoded
    @POST("brand_goods.php")
    Observable<BrandGoodsEntity> brand_goods_request(@Field("request") String request);

    /**
     * 16.商品详情接口
     */
    @FormUrlEncoded
    @POST("goods_values.php")
    Observable<GoodsValuesEntity> goods_values_request(@Field("request") String request);

    /**
     * 17.用户登录接口
     */
    @FormUrlEncoded
    @POST("login.php")
    Observable<UserEntity> login_request(@Field("request") String request);

    /**
     * 18.用户注册接口
     */
    @FormUrlEncoded
    @POST("register.php")
    Observable<UserEntity> register_request(@Field("request") String request);

    /**
     * 19.商品尺寸接口 sel_goods_values.php
     */
    @FormUrlEncoded
    @POST("sel_goods_values.php")
    Observable<SelGoodsValuesEntity> sel_goods_values_request(@Field("request") String request);

    /**
     * 20.加入购物车接口
     */
    @FormUrlEncoded
    @POST("add_car.php")
    Observable<AddCarEntity> add_car_request(@Field("request") String request);

    /**
     * 21.购物车列表接口 car_list.php
     */
    @FormUrlEncoded
    @POST("car_list.php")
    Observable<CarListEntity> car_list_request(@Field("request") String request);

    /**
     * 22.订单接口 create_order.php
     */
    @FormUrlEncoded
    @POST("create_order.php")
    Observable<CreateOrderEntity> create_order_request(@Field("request") String request);

    /**
     * 23.添加收货地址 add_address.php
     */
    @FormUrlEncoded
    @POST("add_address.php")
    Observable<AddAddressEntity> add_address_request(@Field("request") String request);

    /**
     * 24.收货地址列表 address_list.php
     */
    @FormUrlEncoded
    @POST("address_list.php")
    Observable<AddressListEntity> address_list_request(@Field("request") String request);

    /**
     * 25.优惠券列表 coupon_list.php
     */
    @FormUrlEncoded
    @POST("coupon_list.php")
    Observable<CouponListEntity> coupon_list_request(@Field("request") String request);

    /**
     * 26.足迹列表 footprint.php
     */

    /**
     * 27.删除收货地址接口 del_address.php
     */
    @FormUrlEncoded
    @POST("del_address.php")
    Observable<DelAddressEntity> del_address_request(@Field("request") String request);

    /**
     * 28.软件升级接口 upgrade.php
     */

    /**
     * 29.查询用户信息接口 sel_user.php
     */
    @FormUrlEncoded
    @POST("sel_user.php")
    Observable<SelUserEntity> sel_user_request(@Field("request") String request);

    /**
     * 30.上传用户头像接口 upload_head.php
     */
    @Multipart
    @POST("upload_head.php")
    Observable<UploadHeadEntity> upload_head_request(@Part List<MultipartBody.Part> request);

    /**
     * 31.更改用户信息接口 update_user.php
     */
    @FormUrlEncoded
    @POST("update_user.php")
    Observable<UpdateUserEntity> update_user_request(@Field("request") String request);

    /**
     * 32.收藏商品接口 collection.php
     */
    @FormUrlEncoded
    @POST("collection.php")
    Observable<CollectionEntity> collection_request(@Field("request") String request);

    /**
     * 33.取消收藏接口 uncollection.php
     */
    @FormUrlEncoded
    @POST("uncollection.php")
    Observable<UncollectionEntity> uncollection_request(@Field("request") String request);
}
